package com.ziven.common.widget.value;

import android.view.View;
import android.widget.LinearLayout;

import androidx.annotation.NonNull;

import com.ziven.easygo.util.ViewHelper;

/**
 * @author Ziven
 */
public final class Orientation extends Value {

    public static Orientation vertical() {
        return size(LinearLayout.VERTICAL);
    }

    public static Orientation horizontal() {
        return size(LinearLayout.HORIZONTAL);
    }

    public static Orientation size(int orientation) {
        return new Orientation().accept(my -> my.value  = orientation);
    }

    private Orientation() {}

    @Override
    protected void takeEffect(@NonNull ViewHelper<? extends View> helper) {
        value(Integer.class, helper::setOrientation);
    }
}
